/*
 * @Author: yc yangcheng960813@163.com
 * @Date: 2022-09-28 22:09:45
 * @LastEditTime: 2023-02-09 22:08:18
 * @LastEditors: Crazy_Debug yangcheng960813@163.com
 * @Description: 
 * @FilePath: /shaonao2/assets/libs/singleton/SingletonBase.ts
 * 可以输入预定的版权声明、个性签名、空行等
 */

const { ccclass } = cc._decorator;

@ccclass
export default abstract class SingletonBase extends cc.Component {

    private static m_ins = null;

    public static i<T>(c: { new(): T }): T {
        if (!this.m_ins) this.m_ins = new c();
        return this.m_ins;
    }

}